﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Areas.Manage.Models.Lottery.PlayTypeSetModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	玩法设置
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="StyleAndScript" runat="server">
    <script type="text/javascript">
        var url = '<%=Url.Action("ConfigPlayType","Lottery",new{id=""})%>';
        function ddlChage() {
            document.location.href = url + '?id=' + this.value;
        }
        $(document).ready(function () {
            $("#playtypesetform").validate();
            $("#sel_lotterys").change(ddlChage);

            $("#playtypesetform .table #tritem:odd").addClass("supersede");
            $("#playtypesetform .table :text").each(function () {
                $(this).parent().css("text-align", "left");
            });
        });
        
    </script>
    <link href="../../../../Content/Play2.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.BeginForm(new { id = "playtypesetform" }, null); %>
    <fieldset>
        <legend>玩法设置</legend>
        <table class="table" width="100%">
            <tr>
                <th>
                    <%=Html.DropDownListFor(p => p.Lottery, Model.Lotterys.Select(p => new SelectListItem { Text = p.Value, Value = p.Key.ToString(), Selected = p.Key == Model.Lottery }), new { id="sel_lotterys"})%>
                </th>
                <th>
                    状态
                </th>
                <th>顺序</th>
                <th>
                    方案最大注数
                </th>
                <th>
                    方案最大倍数
                </th>
                <th>
                    返点类型
                </th>
                <th>号码限制(“|”分隔)</th>
                <th>
                    每位最多可购买的号码个数
                </th>
            </tr>
            <% var backMoneyTypeList = Code.BLL.CacheManage.BackMoneyType;%>
            <%for (int i = 0; i < Model.PlayTypes.Length; i++) %>
            <%{ %>
            <% var item = Model.PlayTypes[i]; %>
            <tr id="tritem">
                <td>
                    <%=item.Name%>
                    <%=Html.HiddenFor(p=>p.PlayTypes[i].Name) %>
                    <%=Html.HiddenFor(p=>p.PlayTypes[i].ID) %>
                </td>
                <td>
                    <%=Html.CheckBoxFor(p => p.PlayTypes[i].State)%>
                </td>
                <td>
                    <%=Html.TextBoxFor(p => p.PlayTypes[i].Sort, new { @class = "text50" })%>
                    <%=Html.ValidationMessageFor(p => p.PlayTypes[i].Sort)%>
                </td>
                <td>
                    <%=Html.TextBoxFor(p => p.PlayTypes[i].MaxBuyCount, new { @class = "text50" })%>
                    <%=Html.ValidationMessageFor(p => p.PlayTypes[i].MaxBuyCount)%>
                </td>
                <td>
                    <%=Html.TextBoxFor(p => p.PlayTypes[i].MaxBuyMultiple, new { @class = "text50" })%>
                    <%=Html.ValidationMessageFor(p => p.PlayTypes[i].MaxBuyMultiple)%>
                </td>
                <td>
                    <%=Html.DropDownListFor(p=>p.PlayTypes[i].BackMoneyTypeID,backMoneyTypeList.Select(p=>new SelectListItem{Selected=Model.PlayTypes[i].BackMoneyTypeID==p.Value.ID,Text=p.Value.Name,Value=p.Value.ID.ToString()})) %>
                    <%=Html.ValidationMessageFor(p=>p.PlayTypes[i].BackMoneyTypeID) %>
                </td>
                <td>
                    <%=Html.TextBoxFor(p => p.PlayTypes[i].RestrictiveNumber, new { @class="text100"})%>
                    <%=Html.ValidationMessageFor(p=>p.PlayTypes[i].RestrictiveNumber) %>
                </td>
                <td>
                    <%for (int j = 0; j < item.BuyNumbers.Length; j++) %>
                    <%{ %>
                    <%=Html.TextBoxFor(pp => pp.PlayTypes[i].BuyNumbers[j].Len, new { @class = "text20" })%>
                    <%=Html.ValidationMessageFor(pp => pp.PlayTypes[i].BuyNumbers[j].Len)%>
                    <%} %>
                </td>
            </tr>
            <%} %>
            <tr>
                <td colspan="7" align="center">
                    <input type="submit" value="保存" onclick="return confirm('确定提交吗？')" />&nbsp;&nbsp;
                    <input type="reset" value="重设" />
                </td>
            </tr>
        </table>
    </fieldset>
    <%=Html.SerializableFor(p => p.Lotterys) %>
    <% Html.EndForm(); %>
</asp:Content>
